package com.echat.serviceapigateway.security.constant;


import com.echat.serviceapigateway.security.config.CacheConfig;

/**
 * Created by chenmohan on 2018/08/30
 *
 * @description redis的key前缀定义以及key的组装方法
 */
public class RedisContants {

    private static final String authKey = "auth:token:";

    private static final String tokenGetLimtKey="token_limit:";

    public static String authTokenKey(String accessToken) {
        return new StringBuilder().append(authKey).append(accessToken).toString();
    }

    public static String tokenGetLimitKey(Long userId){
        return new StringBuilder().append(CacheConfig.CACHE_TOKEN_GET_LIMIT).append(":").append(userId).toString();
    }
}
